package cn.getech.data.development.service;

import cn.getech.data.development.entity.ModelInfo;
import cn.getech.data.development.model.qo.ModelInfoQO;
import cn.getech.data.development.model.vo.ModelInfoVO;
import cn.getech.data.intelligence.common.utils.PageUtils;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 模型相关 服务类
 * </p>
 *
 * @author hqz
 * @since 2019-08-22
 */
public interface ModelInfoService extends IService<ModelInfo> {
    PageUtils queryPage(ModelInfoQO modelInfoQO);
    void checkUpdateInfo(ModelInfoVO modelInfoVO);
    void checkUploadInfo(ModelInfoVO modelInfoVO);
    void updateFile(MultipartFile file, ModelInfoVO modelInfoVO);
    void uploadFile(MultipartFile file, ModelInfoVO modelInfoVO);
    Map getModelDetials(String id);
    void deleteModle(Integer id);
    BufferedInputStream downloadModel(ModelInfo modelInfo, HttpServletResponse response) throws Exception;
    List getDbTableList() throws Exception;
    void modelTrainData(String sql);
    /**
    * @Description
    * @Date   2019/9/3 20:54
    * @Param   type : 1:返回的value：是名称  2：返回的value:是id
    */
    JSONArray dbTableList(Integer type);
    JSONArray definiteDbTableTree(Integer tableInfoId);

    /**
     * @Description 验证是否有分析任务正在使用这个模型
     * @Author  hujz
     * @Date   2019/9/10 11:11
     * @Param  id:模型id  type: 类型（1:删除  2：编辑）
     * @Return
     * @Exception
     *
     */
    void checkedAnalysisInfo(Integer id, int type);
}
